package com.woniuxy.project115.kaer.mall.consumer;

//import com.alipay.api.AlipayApiException;
import com.woniuxy.project115.kaer.mall.service.RefundService;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class RefundConsumer {
    @Resource
    private RefundService refundService;
    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue(value = "refund_queue"),
                    exchange = @Exchange(value = "refund",type = "direct"),
                    key = "refund_key"
            )
    })
    @RabbitHandler
    public void handleRefund(Integer applyId) throws Exception {
        refundService.handleRefund(applyId);
    }
}
